<template>
  <div>
    <el-button @click="willAdd" type="primary">添加</el-button>
              <!-- 角色列表 -->
            <list-vue @willUpdate="willUpdate" :arr="arr" @init="getlist"></list-vue>
            <!-- 角色表单 -->
            <form-vue :info="info" :arr='arr' @init="getlist" ref="form"></form-vue>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
import listVue from '../role/components/list.vue'
import formVue from '../role/components/form.vue'
import { reqrolelist} from '../../http/api';
import {toggle} from '../../mixins'
export default {
  components:{
    listVue,
    formVue
  },
  mixins:[toggle],
  props: [],
  data() {
    return {
      arr:[],
    };
  },
  computed: {
    ...mapGetters({}),
  },
  mounted() {
    this.getlist();
  },
  methods: {
    ...mapActions({}),
    
   
    //请求列表
    getlist(){
      reqrolelist().then((res)=>{
        if(res.data.code ==200){
          this.arr = res.data.list?res.data.list:[]
        }
      })
    },
  
  },
};
</script>
<style scoped lang="less">
@import "../../less/index.less";
.el-button{
  margin: @margin20 0;
}
</style>